package com.abcdefg.springioc.demo5;

import com.abcdefg.springioc.ComponentDemo;
import com.abcdefg.springioc.ControllerDemo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

@Controller
public class Demo1 {
    //属性注入
//    @Autowired
//    private ControllerDemo controller;
//    @Autowired
//    private ComponentDemo component;

//    //构造方法注入
//    private ControllerDemo controller;
//    private ComponentDemo component;
//    public Demo1() {}
//    @Autowired
//    public Demo1(ControllerDemo controller, ComponentDemo component) {
//        this.controller = controller;
//        this.component = component;
//    }
//    public Demo1(ControllerDemo controller) {
//        this.controller = controller;
//    }

//        private ControllerDemo controller;
//    private ComponentDemo component;
//@Autowired
//    public void setController(ControllerDemo controller) {
//        this.controller = controller;
//    }
//@Autowired
//    public void setComponent(ComponentDemo component) {
//        this.component = component;
//    }



//    public void demo1(){
//        System.out.println("demo1");
//        controller.controllerMethod();
//        component.ComponentMethod();
//    }
}
